#ifndef TESTOPENGL_H
#define TESTOPENGL_H

#include <QImage>
#include "MonWidgetGL.h"

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>

class TestOpenGL : public MonWidgetGL
{
    Q_OBJECT
public:
    explicit TestOpenGL(QWidget *parent = 0);
    void initializeGL();
    void resizeGL(int width, int height);
    void paintGL();
    void loadTexture(QString textureName);
    void keyPressEvent( QKeyEvent *keyEvent );
private :
    GLuint texture[1];
    float f_x;

    GLdouble X, Y, Z;


    /* Le maillage. */
    GLfloat *points;
    GLuint *faces;
    int nbFaces;


    /* Le terrain. */
    GLfloat *pointsTerrain;
    GLuint *facesTerrain;
    int nbFacesTerrain;

    void lireFichier(const char * chemin);
    void lireFichierTerrain(const char *chemin);
};


#endif // TESTOPENGL_H
